/**
 * 北京钉图互动科技 all right reserver
 */
package com.sincebest.fivestar.common.exception;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sincebest.fivestar.common.ErrorCodeEntry;
import com.sincebest.fivestar.common.Response;

/**
 * @author Wangyi
 * @since 2016年6月8日
 */
public class ErrorResponse extends Response {

	private static final long serialVersionUID = 2242805856371693328L;

	/**
	 * 具体的异常信息，供开发查错
	 */
	private String detail;
	/**
	 * 对于HTTP调用返回的status的hint
	 */
	private Integer httpStatusHint;

	public ErrorResponse() {
	}

	public ErrorResponse(String code, String message) {
		super(code, message);
	}

	public ErrorResponse(ErrorCodeEntry errorMapping) {
		super(errorMapping.getCode(), errorMapping.getMessage());
		this.httpStatusHint = errorMapping.getHttpStatusHint();
	}

	/**
	 * @return the detail
	 */
	public String getDetail() {
		return detail;
	}

	/**
	 * @param detail the detail to set
	 */
	public void setDetail(String detail) {
		this.detail = detail;
	}

	/**
	 * @return the httpStatusHint
	 */
	@JsonIgnore
	public Integer getHttpStatusHint() {
		return httpStatusHint;
	}

	/**
	 * @param httpStatusHint the httpStatusHint to set
	 */
	public void setHttpStatusHint(Integer httpStatusHint) {
		this.httpStatusHint = httpStatusHint;
	}

}